/** 
 * @date 06/05/2013
 * @author Renet_Pourriau
 * @version 1.0
 */

package adresse;

/**
 * This class represent place
 */
public class LieuC {

	private Integer num;

	private EnumTypeLieu typeLieu;

	private String complementAdresse;

	private Integer codePostal;

	private Ville ville;

	/**
	 * this is the constructor of place
	 * @param num
	 * @param typeLieu
	 * @param complementAdresse
	 * @param codePostal
	 * @param ville
	 */
	public LieuC(Integer num, EnumTypeLieu typeLieu, String complementAdresse,
			Integer codePostal) {
		this.setNum(num);
		this.setTypeLieu(typeLieu);
		this.setComplementAdresse(complementAdresse);
		if (codePostal < 99999) {
			this.setCodePostal(codePostal);
		}
	}

	/**
	 * @return the num
	 */
	public Integer getNum() {
		return num;
	}

	/**
	 * @param num
	 *            the num to set
	 */
	public void setNum(Integer num) {
		this.num = num;
	}

	/**
	 * @return the typeLieu
	 */
	public EnumTypeLieu getTypeLieu() {
		return typeLieu;
	}

	/**
	 * @param typeLieu
	 *            the typeLieu to set
	 */
	public void setTypeLieu(EnumTypeLieu typeLieu) {
		this.typeLieu = typeLieu;
	}

	/**
	 * @return the complementAdresse
	 */
	public String getComplementAdresse() {
		return complementAdresse;
	}

	/**
	 * @param complementAdresse
	 *            the complementAdresse to set
	 */
	public void setComplementAdresse(String complementAdresse) {
		this.complementAdresse = complementAdresse;
	}

	/**
	 * @return the codePostal
	 */
	public Integer getCodePostal() {
		return codePostal;
	}

	/**
	 * @param codePostal
	 *            the codePostal to set
	 */
	public void setCodePostal(Integer codePostal) {
		if (codePostal < 99999) {
			this.codePostal = codePostal;
		}
	}

	/**
	 * @return the ville
	 */
	public Ville getVille() {
		return ville;
	}

	/**
	 * @param ville
	 *            the ville to set
	 */
	public void setVille(Ville ville) {
		this.ville = ville;
	}

	/**
	 * @return complet adress
	 */
	public String getAdress() {
		return this.getNum() + " " + this.getTypeLieu() + " "
				+ this.getComplementAdresse() + " " + this.getCodePostal()
				+ " " + this.getVille().getNomVille();
	}

}